#include "bsp_Led.h"

void bsp_Led::init()
{
    States = LED_OFF;
    SysDebug("led init!\r\n");
    BSP_GPIO_Write(GPIOx, Pin, States);
}

void bsp_Led::on()
{
    States = LED_ON;
    SysDebug("led on!\r\n");
    BSP_GPIO_Write(GPIOx, Pin, States);
}

void bsp_Led::off()
{
    States = LED_OFF;
    SysDebug("led off!\r\n");
    BSP_GPIO_Write(GPIOx, Pin, States);
}

void bsp_Led::toggle()
{
    if (States == LED_ON)
    {
        States = LED_OFF;
        SysDebug("led off!\r\n");
    }
    else
    {
        States = LED_ON;
        SysDebug("led on!\r\n");
    }
    BSP_GPIO_Write(GPIOx, Pin, States);
}
#if DEMO_LED
bsp_Led demoLed(GPIOC, GPIO_PIN_13);
#endif
